package com.atguigu.reflect02;

import org.junit.Test;

import java.lang.reflect.Constructor;

/**
 * @program: myIDEA
 * @description:
 * @author: Mr.zjx
 * create: 2021-07-03-23-11
 **/
public class ReflectTest02 {
    @Test
    public void testConstructor() throws ClassNotFoundException, NoSuchMethodException {
        Class<?> clazz = Class.forName("com.atguigu.shisong.pojo.Person");
        /*Constructor[] cons = clazz.getConstructors();
        for (Constructor con: cons){
            System.out.println(con);
        }*/
        Constructor con = clazz.getConstructor();
        System.out.println(con);
    }
}
